package com.xaicode.template.mongodb.sewrvice;

import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Locker
 * @date 2021/8/9 0009 16:16
 */
@Service
public class MongodbService {

    @Resource
    private MongoTemplate mongoTemplate;

    public void send(String collectionName, Object content) {
        mongoTemplate.insert(content, collectionName);
    }

}
